package com.ld.project.zkn;

import java.util.EnumMap;
import java.util.HashMap;
import java.util.Map;
import java.util.stream.Stream;

public enum  Phase {
    SOLID, LIQUID, GAS;

    private static final Map<String,Phase> stringToEnum=new HashMap<>();
    static {
        Stream.of(Phase.values()).forEach((op)->{
            stringToEnum.put(op.toString(),op);
        });
    }
    public static Phase frmString(String symbol){
        return stringToEnum.get(symbol);
    }

    public static void main(String[] args) {
       System.out.print( frmString("SOLID"));;
    }
}
